<h1 id="titlename">添加分类</h1>
<div class="clear">
    <div class="row">
        <div class="col-sm-10 col-sm-offset-1">
            <div class="col-sm-9 col-sm-offset-2">
                <div <?php $err = validation_errors(); echo !(empty($error) && empty($err)) ? 'class="alert alert-danger text-center"' : '' ?>><?php echo validation_errors(); ?><?php echo $error ?></div>
            </div>
<?php echo form_open('poster_admin/category/create', array('class'=>'form-horizontal','role'=>'form')); ?>

            <div class="form-group">
                <label for="name" class="col-sm-2 control-label">分类名</label>
                <div class="col-sm-9">
                    <input type="text" name="name" class="form-control" id="name" size="20" placeholder="分类名"/>
                </div>
            </div>
            <div class="form-group">
                <div class="form-inline">

                <label for="year" class="col-sm-2 control-label">Deadline</label>
                <div class="col-sm-10">
                            <select class="form-control" name="year" id="year">
                                <?php for($i = 2014; $i <= 2080; $i++) echo '<option value="'.$i.'"'.(date("Y") == $i?'selected':'').'>'.$i.'</option>'; ?>
                            </select>年
                            <select class="form-control" name="month" id="month">
                                <?php for($i = 1; $i <= 12; $i++) echo '<option value="'.(strlen($i) == 1? '0'.$i : $i).'"'.(date("m") == $i?'selected':'').'>'.(strlen($i) == 1? '0'.$i : $i).'</option>'; ?>
                            </select>月
                            <select class="form-control" name="day" id="day">
                                <?php for($i = 1; $i <= 31; $i++) echo '<option value="'.(strlen($i) == 1? '0'.$i : $i).'"'.(date("d") == $i?'selected':'').'>'.(strlen($i) == 1? '0'.$i : $i).'</option>'; ?>
                            </select>日
                            <select class="form-control" name="hour" id="hour">
                                <?php for($i = 0; $i <= 23; $i++) echo '<option value="'.(strlen($i) == 1? '0'.$i : $i).'"'.(date("H") == $i?'selected':'').'>'.(strlen($i) == 1? '0'.$i : $i).'</option>'; ?>
                            </select> :
                            <select class="form-control" name="minute" id="minute">
                                <?php for($i = 0; $i <= 59; $i++) echo '<option value="'.(strlen($i) == 1? '0'.$i : $i).'"'.(date("i") == $i?'selected':'').'>'.(strlen($i) == 1? '0'.$i : $i).'</option>'; ?>
                            </select> :
                            <select class="form-control" name="second" id="second">
                                <?php for($i = 0; $i <= 59; $i++) echo '<option value="'.(strlen($i) == 1? '0'.$i : $i).'"'.(date("s") == $i?'selected':'').'>'.(strlen($i) == 1? '0'.$i : $i).'</option>'; ?>
                            </select>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-offset-2 col-sm-10">
                    <input type="submit"  class="btn btn-primary btn-block btn-lg" value="提交" />
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-offset-2 col-sm-10">
                    <a href="<?php echo base_url().'poster_admin/category'?>"><button type="button" class="btn btn-default btn-lg btn-block">返回到列表</button></a>
                </div>
            </div>

</form>
        </div>
    </div>
</div>